package music

import (
	"github.com/micro/go-micro/v2"
	"github.com/micro/go-micro/v2/client"
	pb "micro-grpc-server/services/music/proto"
)

func NewMusicClient() pb.MusicService {
	server := micro.NewService(
		micro.Name("go.micro.srv.music.client"),
		micro.Version("latest"),
	)
	server.Init()

	cli := server.Client()
	// 禁止自动重试
	_ = cli.Init(client.Retries(0))
	return pb.NewMusicService("go.micro.srv.music", cli)
}
